<?php
include 'connect.php';
$id=$_GET['id'];

echo '
<form action="" method="post">
  Reason <input type="text" id="reason" name="reason" /><br />
  <input type="submit" value="Submit" />
</form>
';
$reason = $_POST['reason'];
if (isset($reason))
{
$sql="UPDATE scp_slavesite set failedreason=N'".$reason."' WHERE slid='".$id."'";
if (!mysql_query($sql,$connect))
  {
  die('Error: ' . mysql_error());
  }
echo "Reason has been added";
}
mysql_close($connect); 
?>